<template>
  <div style="background-color: #f7f7f7">
    <div class="register-wrapper">
      <ProductRentOut @submit="submit"></ProductRentOut>
    </div>
  </div>
</template>

<script>
import ProductRentOut from "@/components/ProductRentOut";
import { addProduct } from "@/api/product.js";
export default {
  name: "productFormSell",
  components: {
    ProductRentOut,
  },
  data() {
    return {};
  },
  methods: {
    submit(e) {
      addProduct(e).then((res) => {
        this.$modal.msgSuccess("发布成功，请等待审核");
        setTimeout(() => {
          this.$router.replace("/index");
        }, 800);
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.register-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 1200px;
  background: #ffffff;
  border-radius: 0px;
  padding: 60px 0;
  margin: 0 auto 30px;
}
</style>
